<%@page import="systems.ConfigSystem"%>
<%@page import="systems.AdsSystem"%>
<%@page import="helpers.UrlHelper"%>
<%@page import="entities.SiteConfig"%>
<%
SiteConfig siteConfig = ConfigSystem.getConfigs();
String title = (String) request.getParameter("title");
String description = (String) request.getParameter("description");
String keywords = (String) request.getParameter("keywords");
String ogSiteName = (String) request.getParameter("ogsite_name");
String ogTitle = (String) request.getParameter("ogtitle"); 
String ogUrl = (String) request.getParameter("ogurl");
String ogImage = (String) request.getParameter("ogimage");
String ogDescription = (String) request.getParameter("ogdescription");

if (title == null && siteConfig != null)
	title = siteConfig.getTitle();

if (description == null && siteConfig != null)
	description = siteConfig.getMetaDescription();

if (keywords == null && siteConfig != null)
	keywords = siteConfig.getMetaKeywords();

if (ogSiteName == null && siteConfig != null)
	ogSiteName = siteConfig.getSiteName();

if (ogTitle == null && siteConfig != null)
	ogTitle = siteConfig.getTitle();

if (ogDescription == null && siteConfig != null)
	ogDescription = siteConfig.getMetaDescription();

if (ogUrl == null)
	ogUrl = UrlHelper.getServerUrl(request);

if (ogImage == null)
	ogImage = "http://immediatenet.com/t/t_a?Size=1024x768&URL=" + UrlHelper.getDomainServer(request);

%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<%=siteConfig.getHttpCharacterSet().toUpperCase()%>">
<meta name="description" content="<%=description.replaceAll("[\"\']+", "")%>" >
<meta name="Keywords" content="<%=keywords.replaceAll("[\"\']+", "")%>" >
<meta itemprop="name" content="<%=ogTitle.replaceAll("[\"\']+", "")%>" />    
<meta itemprop="description" content="<%=ogDescription %>" />
<meta property="og:site_name" content="<%=ogSiteName %>" >
<meta property="og:title" content="<%=ogTitle.replaceAll("[\"\']+", "")%>" >
<meta property="og:url" content="<%=ogUrl%>" >
<meta property="og:image" content="<%=ogImage%>" >
<meta property="og:description" content="<%=ogDescription %>" >
<title><%=title%></title>

<link rel="stylesheet" href="/templates/<%=siteConfig.getTemplate() %>/css/style.css" type="text/css" />
<link rel="stylesheet" href="/templates/<%=siteConfig.getTemplate() %>/css/custom.css" type="text/css" />
<script type="text/javascript" src="/templates/<%=siteConfig.getTemplate() %>/js/jquery-1.7.2.min.js"></script>
</head>
<body>
<!-- header -->
<nav id="navTop">
	<div class="wraperContent clearafter">
		<div class="topMenu left">
			<ul class="menu clearafter">
				<li>
					<a href="/about-us">About</a>
				</li>
				<li>
					<a href="/sitemap">Sitemap</a>
				</li>
				<li>
					<a href="/contact-us">Contact Us</a>
				</li>
			</ul>
		</div>
		<div class="topAdv right">
			<%=AdsSystem.getAds468x15() %>
		</div>
	</div>
</nav>
	
<section id="banner">
	<div class="wraperContent clearafter">
		<div class="logo left">
			<a href="/">
				<% if (siteConfig.getLogo().isEmpty()) { %>
				<img src="/templates/<%=siteConfig.getTemplate() %>/images/logo.png" height="50">
				<% } else { %>
				<img src="<%=siteConfig.getLogo()%>">
				<% } %>
			</a>
		</div>
		<div class="right"></div>
	</div>
</section>

<nav id="navMenu">
	<div class="wraperContent clearafter">
		<div class="mainMenu left">
			<ul class="menu">
				<li class="active">
					<a href="/">Home</a>
				</li>
				<li>
					<a href="/about-us">About</a>
				</li>
				<li>
					<a href="/authors">Users</a>
				</li>
			</ul>
		</div>
		<div class="search right">
			<form id="searchForm" method="get" action="/search">
				<input name="q" type="text" class="textfield" value="" placeholder="Find a Question">
				<input type="image" class="btnSearch" src="/templates/<%=siteConfig.getTemplate() %>/images/btn_search.png" >
			</form>
		</div>
	</div>
</nav>
<!-- end header -->

<!-- content -->
<section id="main">
	<div class="wraperContent">